/**
 * Copyright (c) 2006-2007 Jinyi.lu
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of GNU LGPL license by gun.org
 * which accompanies this distribution, and is available at
 * http://gnu.feld-it.at/copyleft/lesser.html
 * 
 * Project Homepage : http://code.google.com/p/demou
 * Source Code: svn checkout http://demou.googlecode.com/svn/trunk/ demou
 * Mailing list : jinyi.lu@gmail.com
 *                stonelu@126.com
 *
 *  
 * Contributors:
 *     JinYi.Lu - initial API and implementation
 */
package cn.tworen.demou.queue;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import cn.tworen.demou.Config;


/**
 * Created on  2007-1-25
 *
 * Title       : ThreadFactory.java
 * Description : 
 * 
 * @author     : LuJinYi
 * @version    : 1.0
 * @Date       : 2007-1-25
 * History     : 
 * 
 */
public class ThreadFactory {
	private final static LinkedBlockingQueue linkedBlockingQueue = new LinkedBlockingQueue();
	private final static ThreadPoolExecutor executor=new ThreadPoolExecutor(
			Config.getInstance().readInt("Thread.CorePoolSize"),
			Config.getInstance().readInt("Thread.KeepAliveTime"),
			Config.getInstance().readInt("Thread.CorePoolSize"),
			TimeUnit.SECONDS,
			linkedBlockingQueue
	);
//	Config.getInstance().readInt("Thread.MaximumPoolSize"),
	public static ThreadPoolExecutor getThreadPool() {
		return executor;
	}
	private void sample() {
		ThreadFactory.getThreadPool().execute(new Runnable(){
			public void run() {
				try {
	
				} catch (Exception e) {
					//logger.error(e);
				}
			}
		});
	}
}
